//
//  DeviceTableDataSource.h
//  MusicAnalyzer
//
//  Created by jiro on 12/03/24.
//  Copyright 2012 jiro music. All rights reserved.
//

#import <Cocoa/Cocoa.h>
#import "../../../Common/DeviceSystem.h"
#import <vector>

@interface DeviceTableDataSource : NSObject< NSTableViewDataSource >
{
@private

	IBOutlet NSTableView* tableView;	
	
	/**	@remark this class  don't delete deviceInfos and each sc::DeviceInfo, even when class dealloced	*/
	std::vector< sc::DeviceInfo* >* deviceInfos;	

}

@property ( readwrite ) std::vector< sc::DeviceInfo* >* deviceInfos;
@property ( readwrite ) BOOL displayOnlyMidiDevice;

//	---- implement of protocol NSTableViewDataSource ---- //
- (NSInteger)numberOfRowsInTableView:(NSTableView *)tableView;
- (id)tableView: (NSTableView *) tableView
	objectValueForTableColumn: (NSTableColumn *) tableColumn 
	row: (NSInteger) row;
//	----------------------------------------------------- //

- (void) reloadData;

/**	@remark this method copy deive pointer, it's appContrll responsibility to delete sc::DeviceInfo*.	*/
- (void) addDeviceInfo: ( sc::DeviceInfo* ) info;
- (void) addDeviceInfos: ( const std::vector< sc::DeviceInfo* >* ) infos;
- (void) setDisplayOnlyMidiDevice: (BOOL) YesOrNo;
- (void) selectRowOf: ( const sc::DeviceInfo* ) info;
- (sc::DeviceInfo*) usbMidiDeviceInfoOrderAt: (int) order;
- (sc::DeviceInfo*) selectedDeviceInfo;
- (void) clearDeviceInfos;
- (void) deselectAll;
- (BOOL) isDeviceInfoDisplayed: ( const sc::DeviceInfo* ) info;

- (std::vector< sc::DeviceInfo*>*) getDeviceInfos;

@end
